package com.ruoyi.system.service.impl;

import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.system.domain.SysIncome;
import com.ruoyi.system.mapper.SysIncomeMapper;
import com.ruoyi.system.service.ISysIncomeService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 收益Service业务层处理
 * 
 * @author paul
 * @date 2023-06-25
 */
@Service
public class SysIncomeServiceImpl implements ISysIncomeService
{
    @Resource
    private SysIncomeMapper sysIncomeMapper;

    /**
     * 查询收益
     * 
     * @param id 收益主键
     * @return 收益
     */
    @Override
    public SysIncome selectSysIncomeById(Long id)
    {
        return sysIncomeMapper.selectSysIncomeById(id);
    }

    /**
     * 查询收益列表
     * 
     * @param sysIncome 收益
     * @return 收益
     */
    @Override
    public List<SysIncome> selectSysIncomeList(SysIncome sysIncome)
    {
        return sysIncomeMapper.selectSysIncomeList(sysIncome);
    }

    /**
     * 新增收益
     * 
     * @param sysIncome 收益
     * @return 结果
     */
    @Override
    public int insertSysIncome(SysIncome sysIncome)
    {
        sysIncome.setCreateTime(DateUtils.getNowDate());
        return sysIncomeMapper.insertSysIncome(sysIncome);
    }

    /**
     * 修改收益
     * 
     * @param sysIncome 收益
     * @return 结果
     */
    @Override
    public int updateSysIncome(SysIncome sysIncome)
    {
        sysIncome.setUpdateTime(DateUtils.getNowDate());
        return sysIncomeMapper.updateSysIncome(sysIncome);
    }

    /**
     * 批量删除收益
     * 
     * @param ids 需要删除的收益主键
     * @return 结果
     */
    @Override
    public int deleteSysIncomeByIds(Long[] ids)
    {
        return sysIncomeMapper.deleteSysIncomeByIds(ids);
    }

    /**
     * 删除收益信息
     * 
     * @param id 收益主键
     * @return 结果
     */
    @Override
    public int deleteSysIncomeById(Long id)
    {
        return sysIncomeMapper.deleteSysIncomeById(id);
    }
}
